<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title>Insert title here</title>
</head>
<body>
 <button onclick="getResult();">添加项目信息</button>
<!--table start-->
<div class="tablebox mrt10" id="projectbaseinfo">
    <!--用刚才创建的jsonData数组创建一个ItemFileReadStore。grid填充数据用的是store-->
    <div class="tabletile"><span class="tabletitletx">项目基本信息</span></div>

    <table class="tablestyle overview" id="overviewtable">
        <thead>
        <tr>
            <th class="th0">项目编号</th>
            <th class="th1">项目名称</th>
            <th class="th2" onClick="sortTable('overviewtable',2);">
                	立项时间<span>↑</span>
            </th>
            <th class="th3" onClick="sortTable('overviewtable',3);">
               		 资金<span>↑</span>
            </th>
            <th class="th4" >成本</th>
            <th class="th5">Action</th>
        </tr>
        </thead>
        <tbody>

        <tr>
            <td><&=data[i].projectcode&></td>
            <td>pz-sensor-1</td>
            <td>3F</td>
            <td>20/140</td>
            <td><img src="images/sensor_red.png"/> </td>
            <td>
                <a href="#" class="actionedit"></a>
                <a href="#" class="actiondel"></a>
            </td>
        </tr>
  <tr>
            <td><&=data[i].projectcode&></td>
            <td>pz-sensor-1</td>
            <td>3F</td>
            <td>20/140</td>
            <td><img src="images/sensor_red.png"/> </td>
            <td>
                <a href="#" class="actionedit"></a>
                <a href="#" class="actiondel"></a>
            </td>
        </tr>
          <tr>
            <td><&=data[i].projectcode&></td>
            <td>pz-sensor-1</td>
            <td>3F</td>
            <td>20/140</td>
            <td><img src="images/sensor_red.png"/> </td>
            <td>
                <a href="#" class="actionedit"></a>
                <a href="#" class="actiondel"></a>
            </td>
        </tr>


        </tbody>
        <tfoot>
        <tr>
            <td colspan="7">
                <div class="tfootleft">Show:<a href="#" class="current">10</a><a href="#">25</a><a href="#">50</a><a href="#">100</a>Items</div>
                <div class="tfootmid">
                    <a href="#">1</a>
                    <a href="#" class="current">2</a>
                    <a href="#">3</a>
                    <a href="#">4</a>
                    <span>...</span>
                    <a href="#">11</a>
                    <a href="#">12</a>
                </div>
                <div class="tfootright">
                    <a href="#">Previous</a>|<a href="#">Next</a>
                </div>
            </td>
        </tr>
        </tfoot>
    </table>

</div>
<!--table end-->
</body>
</html>


<script type="text/javascript">
  function getResult() {
var url = "servlet/BindProjectBaseInfo?state=all"; 
//var url = "servlet/SelectCityServlet?state=all"; 
　　 if (window.XMLHttpRequest) { 
　　 req = new XMLHttpRequest(); 
　　 }else if (window.ActiveXObject) { 
　　 req = new ActiveXObject("Microsoft.XMLHTTP"); 
　　 } 
　　 if(req){ 
　　 req.open("GET",url, true); 
　　 req.onreadystatechange = complete; 
　　 req.send(null); 
　　 } 
} 
function complete(){
　　 if (req.readyState == 4) { 
　　 if (req.status == 200) { 
　　// var city = req.responseXML.getElementsByTagName("city"); 
　//alert(req.responseText);
var data = req.responseText;
document.getElementById('projectbaseinfo').innerHTML = template.render('projectBaseInfoTable', data);
　　 }
　　 }
}
function buildSelect(str,sel) {
　　 sel.options.length=0;
　　 for(var i=0;i<str.length;i++) {
　　 sel.options[sel.options.length]=new Option(str[i],str[i])
　　 }
}
</script>